package com.yjj.demo.thread.web;

import com.yjj.demo.thread.service.ThreadPoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * description
 *
 * @author yangjiajia
 * @time 2022/3/22 14:19
 */
@RestController
public class ThreadPoolController {

    @Autowired
    private ThreadPoolService threadPoolService;

    @RequestMapping("/pool/cancel")
    public void cancel(@RequestParam("taskId") int taskId) {
        threadPoolService.cancel(taskId);
    }

    @RequestMapping("/pool/task")
    public void task(@RequestParam("taskId") int taskId) {
        threadPoolService.task(taskId);
    }
}
